home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / shell-tools / flp_by_anp / waitreturn.doc < prev    next >
Encoding:
Text File  |  1996-02-24  |  4.4 KB  |  103 lines

  1.  
  2. *****************************************************************************
  3. * Project Details                                                           *
  4. * ---------------                                                           *
  5. * Project Name:    WaitReturn                                               *
  6. * Project Version: 1                                                        *
  7. * Copyright:       Anthony N Peck                                           *
  8. * Date:            Sunday 21st May 1995                                     *
  9. *                                                                           *
  10. * Contact:                                                                  *
  11. * 68 Woralul ST                                                             *
  12. * Waramanga ACT 2611                                                        *
  13. * Australia                                                                 *
  14. *                                                                           *
  15. * E-Mail: Anthony.Peck@Radford.act.edu.au                                   *
  16. *                                                                           *
  17. *****************************************************************************
  18. * File Summary:                                                             *
  19. * ------------                                                              *
  20. *                                                                           *
  21. * Usage: WaitReturn                                                         *
  22. *                                                                           *
  23. * Inspired by other similar programs, this is my own attempt at a little    *
  24. * program you can use in a script file to halt the progress of the script   *
  25. * until the user presses the RETURN key.  Enjoy!                            *
  26. *                                                                           *
  27. *****************************************************************************
  28.  
  29. ; Some Quick equivalents...
  30.  
  31. ExecBase                = $04      ; Exec Base...ahem
  32. SZMess                  = $1C      ; Size of message
  33. _LVOOpenlibrary         = -$0228   ; Exec function opens libraries
  34. _LVOCloselibrary        = -$019E   ; Exec function closes libraries
  35. _LVOWrite               = -$30     ; Dos function writes to shell
  36. _LVOOutput              = -$3C     ; Dos function gets output handle
  37. _LVOInput               = -$36     ; Dos function gets input handle
  38. _LVORead                = -$2A     ; Dos function reads from shell
  39.  
  40. ; A couple of Macros...
  41.  
  42. EXEC            Macro
  43.         MOVE.L  ExecBase,A6        ; Move Exec into a6
  44.         JSR     _LVO\1(A6)         ; Add Library offset and call function
  45.                 Endm
  46.  
  47. CALLDOS         Macro
  48.         MOVE.L  _DosBase,A6        ; Move Dos into a6
  49.         JSR     _LVO\1(A6)         ; Add Library offset and call function
  50.                 Endm
  51.  
  52. Start:
  53.  
  54. ; Program starts here!
  55.  
  56.         LEA     Dosname,A1         ; Load the dos library
  57.         CLR.L   D0                 ; Any version will do
  58.         EXEC    Openlibrary        ; Macro opens library
  59.         BEQ     Exit               ; If there's a problem, close down
  60.         MOVE.L  D0,_DosBase        ; Save the return address
  61.         CALLDOS Output             ; Call the output function
  62.         BEQ     Close              ; No can do so outta here ->
  63.         MOVE.L  D0,D1              ; Shift output handle to D1
  64.         MOVE.L  #Message,D2        ; This is the message...
  65.         MOVE.L  #SZMess,D3         ; ...plus the length of the message...
  66.         CALLDOS Write              ; ..and write it  
  67.         CALLDOS Input              ; Call the input function
  68.         MOVE.L  D0,D1              ; Shift input handle to D1
  69.         MOVE.L  ReadSpace,D2       ; the memory for a read
  70.         MOVE.L  #$01,D3            ; One byte or two?
  71.         CALLDOS Read               ; ..and write it
  72.  
  73. Close:        
  74.  
  75.         MOVE.L   _DosBase,A1       ; Move dos base into a1
  76.         EXEC     Closelibrary      ; Macro closes dos
  77.  
  78. Exit:
  79.  
  80.         CLR.L    D0                ; Clear D0
  81.         RTS                        ; Return To System
  82.  
  83.  
  84. _DosBase:  
  85.  
  86.         DC.L    $1                 ; Memory for Dos Base
  87.  
  88. ReadSpace:
  89.  
  90.         DC.B    $1                 ; Memory for Read
  91.  
  92. Dosname:
  93.  
  94.         DC.B    "dos.library",$00  ; dos library name
  95.  
  96. Message:
  97.  
  98.         DC.B    "     "            ; The actual text
  99.         DC.B    "Press Return: "   ;
  100.  
  101.         END
  102.  
  103.